package TEST;


import static org.junit.Assert.*;

import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;

import client.GUI.namegui;

public class nameguiTest {
	static namegui namegui;

	@BeforeClass
	public static void setUpBeforeClass() throws Exception {
		namegui = new namegui();
		namegui.aken.setVisible(false);
	}

	@Test
	public void TitleTest(){
		assertEquals("Nimi",namegui.aken.getTitle());
	}

	@Test
	public void SizeTest(){
		assertEquals(204,namegui.aken.getWidth());
		assertEquals(167,namegui.aken.getHeight());
	}

	@Test
	public void CloseOperationTest(){
		assertEquals(3,namegui.aken.getDefaultCloseOperation());
	}

	@Test
	public void LableTest(){
		assertEquals(22,namegui.lbl.getHeight());
		assertEquals(148,namegui.lbl.getWidth());
		assertEquals("Palun sisestage nimi : ",namegui.lbl.getText());
	}

	@Test
	public void ButtonTest(){
		assertEquals("OK",namegui.Submit.getLabel());	
	}

	@Test
	public void ButtonSubmitTest(){
		namegui.getNameBox().setText("TestName");
		namegui.submit();
	}

	@AfterClass
	public static void tearDownAfterClass() throws Exception {
		namegui.dispose();
	}

}
